import java.util.Scanner;

public class Test {
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (!scanner.hasNext("舌头")){//如果输入的值不是“舌头”，就打印出来
            System.out.println("吃"+scanner.next());
        }
        System.out.println("咬到舌头了！！！");
    }
    public static void main(String[] args) {//在同一个类中调用scanner.close关闭scan后是否可以再次开启(不能)
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        System.out.println(a);
        scanner.close();//scanner类关闭
        Scanner input = new Scanner(System.in);//试图再次调用scanner类
        String b = input.nextLine();
        System.out.println(b);
    }
    public static void main3(String[] args) {//hasNext...
        Scanner scanner = new Scanner(System.in);
        boolean a = scanner.hasNextInt();
        System.out.println(a);
    }
        public static void main12(String []args) {//Next...
            Scanner input = new Scanner(System.in);
            System.out.println("请输入一个字符串(中间含有空格)");
            while(input.hasNext()){//如果输入的还有内容，就继续循环
                System.out.println(input.next());
            }

//            System.out.println("请输入一个整数");
//            int c;
//            c = input.nextInt();
//            System.out.println("请输入一个double类型的小数");
//            double d = input.nextDouble();
//            System.out.println("请输入一个float类型的小数");
//            float f = input.nextFloat();
//            System.out.println("按顺序输出abcdf的值：");

//            System.out.println(c);
//            System.out.println(d);
//            System.out.println(f);
    }

    public static void main11(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String b = scanner.nextLine();
        System.out.println("包含空格的字符串打印结果："+b);
        //说明nextLine可以读取空格，但是当敲击空格时读取停止
    }
}
